We can also subset to remove rows or columns that we do not want to see by using the - operator applied to the c function:
my_matrix[-c(1:3), -c(1:3)]
## [,1] [,2] [,3] [,4] [,5] [,6] [,7]
## [1,] 34 44 54 64 74 84 94
## [2,] 35 45 55 65 75 85 95
## [3,] 36 46 56 66 76 86 96
## [4,] 37 47 57 67 77 87 97
## [5,] 38 48 58 68 78 88 98
## [6,] 39 49 59 69 79 89 99
## [7,] 40 50 60 70 80 90 100
In the code, 1:3 creates a vector of the integers 1, 2 and 3, and the - operator negates these. We wrap the vector in the c function so that - applies to each element, and not just the first element.